VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "utilMesa"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
Public Event Click()

Public Enum Estado
    Libre = 1
    Ocupada = 2
    En_Caja = 3
End Enum
Private mvarEstado As Estado
Private mvarDescripcion As String
Private mvarimgMesa As Image
Private mvarlblDescripcion As Label

Private Sub Class_Terminate()

    Set mvarimgMesa = Nothing

    Set mvarlblDescripcion = Nothing
End Sub


Public Property Get Estado() As Estado
    Estado = mvarEstado
End Property

Public Property Let Estado(ByVal Estado As Estado)
    mvarEstado = Estado
    If Estado = En_Caja Then
        imgMesa.Picture = imgAzul.Picture
    ElseIf Estado = Libre Then
       imgMesa.Picture = imgVerde.Picture
    ElseIf Estado = Ocupada Then
        imgMesa.Picture = imgRoja.Picture
    End If
    Call UserControl.PropertyChanged("Estado")
End Property

Public Property Get Descripcion() As String
    Descripcion = mvarDescripcion
End Property

Public Property Let Descripcion(ByVal sDescripcion As String)
    mvarDescripcion = sDescripcion
    lblMesa.Caption = sDescripcion
    Call UserControl.PropertyChanged("sDescripcion")
End Property

Private Sub imgMesa_Click()
RaiseEvent Click
End Sub

Private Sub lblMesa_Click()
RaiseEvent Click
End Sub


Public Property Get imgMesa() As Image

    Set imgMesa = mvarimgMesa

End Property

Public Property Set imgMesa(imgMesa As Image)

    Set mvarimgMesa = imgMesa

End Property

Public Property Get lblDescripcion() As Label

    Set lblDescripcion = mvarlblDescripcion

End Property

Public Property Set lblDescripcion(lblDescripcion As Label)

    Set mvarlblDescripcion = lblDescripcion

End Property
